package com.shop.shoporder.service.impl;


import com.shop.shoporder.entity.GroupbuyGood;
import com.shop.shoporder.entity.GroupbuyGoodInfo;
import com.shop.shoporder.mapper.GroupbuyGoodMapper;
import com.shop.shoporder.service.GroupbuyGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("/groupbuyGoodService")
public class GroupbuyGoodServiceImpl implements GroupbuyGoodService {

    @Autowired
    GroupbuyGoodMapper groupbuyGoodMapper;

    @Override
    public int deleteByPrimaryKey(int groupbuygoodId) {
        return groupbuyGoodMapper.deleteByPrimaryKey(groupbuygoodId);
    }

    @Override
    public int insert(GroupbuyGood record) {
        return groupbuyGoodMapper.insert(record);
    }

    @Override
    public int insertSelective(GroupbuyGood record) {
        return groupbuyGoodMapper.insertSelective(record);
    }

    @Override
    public GroupbuyGood selectByPrimaryKey(int groupbuygoodId) {
        return groupbuyGoodMapper.selectByPrimaryKey(groupbuygoodId);
    }

    @Override
    public int updateByPrimaryKeySelective(GroupbuyGood record) {
        return groupbuyGoodMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(GroupbuyGood record) {
        return updateByPrimaryKey(record);
    }

    @Override
    public List<GroupbuyGoodInfo> getGroupbuyGooods() {


        return   groupbuyGoodMapper.getGroupbuyGooods();
    }

    @Override
    public GroupbuyGood getGroupbuyGood(int groupbuygoodId) {
        return groupbuyGoodMapper.getGroupbuyGood(groupbuygoodId);
    }

    @Override
    public List<GroupbuyGoodInfo> getGroupbuyGoodByClassfyId(int classfyId) {
        return groupbuyGoodMapper.getGroupbuyGoodByClassfyId(classfyId);
    }

    @Override
    public GroupbuyGood getGroupbuyGoodByGoodIdAndSpecId(int goodId, int specId) {
        return groupbuyGoodMapper.getGroupbuyGoodByGoodIdAndSpecId(goodId, specId);
    }

    @Override
    public GroupbuyGoodInfo getGoodInfoByGoodIdAndSpecId(int goodId, int specId) {
        return groupbuyGoodMapper.getGoodInfoByGoodIdAndSpecId(goodId, specId);
    }

    @Override
    public List<GroupbuyGood> getGroupbuyGoodListByGoodId(int goodId) {
        return groupbuyGoodMapper.getGroupbuyGoodListByGoodId(goodId);
    }
}
